﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x0200009C RID: 156
	public class TCreateViewSqlStatement : TCustomSqlStatement
	{
		// Token: 0x170000B2 RID: 178
		// (get) Token: 0x060004B3 RID: 1203 RVA: 0x002FBCF1 File Offset: 0x002F9EF1
		// (set) Token: 0x060004B2 RID: 1202 RVA: 0x002FBCE8 File Offset: 0x002F9EE8
		public virtual TSelectSqlStatement Subquery
		{
			get
			{
				return this.subquery;
			}
			set
			{
				this.subquery = value;
			}
		}

		// Token: 0x170000B3 RID: 179
		// (get) Token: 0x060004B5 RID: 1205 RVA: 0x002FBD02 File Offset: 0x002F9F02
		// (set) Token: 0x060004B4 RID: 1204 RVA: 0x002FBCF9 File Offset: 0x002F9EF9
		public virtual TViewAliasClause ViewAliasClause
		{
			get
			{
				return this.viewAliasClause;
			}
			set
			{
				this.viewAliasClause = value;
			}
		}

		// Token: 0x170000B4 RID: 180
		// (get) Token: 0x060004B7 RID: 1207 RVA: 0x002FBD13 File Offset: 0x002F9F13
		// (set) Token: 0x060004B6 RID: 1206 RVA: 0x002FBD0A File Offset: 0x002F9F0A
		public virtual TSourceToken StForce
		{
			get
			{
				return this.stForce;
			}
			set
			{
				this.stForce = value;
			}
		}

		// Token: 0x170000B5 RID: 181
		// (get) Token: 0x060004B9 RID: 1209 RVA: 0x002FBD24 File Offset: 0x002F9F24
		// (set) Token: 0x060004B8 RID: 1208 RVA: 0x002FBD1B File Offset: 0x002F9F1B
		public virtual TSourceToken StReplace
		{
			get
			{
				return this.stReplace;
			}
			set
			{
				this.stReplace = value;
			}
		}

		// Token: 0x170000B6 RID: 182
		// (get) Token: 0x060004BB RID: 1211 RVA: 0x002FBD35 File Offset: 0x002F9F35
		// (set) Token: 0x060004BA RID: 1210 RVA: 0x002FBD2C File Offset: 0x002F9F2C
		public virtual TObjectName RowTypeName
		{
			get
			{
				return this.rowTypeName;
			}
			set
			{
				this.rowTypeName = value;
			}
		}

		// Token: 0x170000B7 RID: 183
		// (get) Token: 0x060004BD RID: 1213 RVA: 0x002FBD46 File Offset: 0x002F9F46
		// (set) Token: 0x060004BC RID: 1212 RVA: 0x002FBD3D File Offset: 0x002F9F3D
		public virtual TRestrictionClause RestrictionClause
		{
			get
			{
				return this.restrictionClause;
			}
			set
			{
				this.restrictionClause = value;
			}
		}

		// Token: 0x170000B8 RID: 184
		// (get) Token: 0x060004BF RID: 1215 RVA: 0x002FBD57 File Offset: 0x002F9F57
		// (set) Token: 0x060004BE RID: 1214 RVA: 0x002FBD4E File Offset: 0x002F9F4E
		public virtual TObjectName ViewName
		{
			get
			{
				return this.viewName;
			}
			set
			{
				this.viewName = value;
			}
		}

		// Token: 0x060004C0 RID: 1216 RVA: 0x002FBD5F File Offset: 0x002F9F5F
		public TCreateViewSqlStatement(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstcreateview;
		}

		// Token: 0x060004C1 RID: 1217 RVA: 0x002FBD6F File Offset: 0x002F9F6F
		internal override void buildsql()
		{
		}

		// Token: 0x060004C2 RID: 1218 RVA: 0x002FBD71 File Offset: 0x002F9F71
		internal override void clear()
		{
		}

		// Token: 0x060004C3 RID: 1219 RVA: 0x002FBD73 File Offset: 0x002F9F73
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x060004C4 RID: 1220 RVA: 0x002FBD7A File Offset: 0x002F9F7A
		internal virtual void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x060004C5 RID: 1221 RVA: 0x002FBD7C File Offset: 0x002F9F7C
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TCreateViewSqlNode tcreateViewSqlNode = (TCreateViewSqlNode)this.rootNode;
			base.doParseStatement(psql);
			this.viewName = tcreateViewSqlNode.ViewName;
			this.rowTypeName = tcreateViewSqlNode.RowTypeName;
			this.subquery = new TSelectSqlStatement(this.dbvendor);
			this.subquery.rootNode = tcreateViewSqlNode.SelectSqlNode;
			this.subquery.doParseStatement(this);
			if (tcreateViewSqlNode.ViewAliasClause != null)
			{
				tcreateViewSqlNode.ViewAliasClause.doParse(this, ESqlClause.viewAlias);
				this.viewAliasClause = tcreateViewSqlNode.ViewAliasClause;
			}
			this.restrictionClause = tcreateViewSqlNode.RestrictionClause;
			this.stForce = tcreateViewSqlNode.StForce;
			this.stReplace = tcreateViewSqlNode.StReplace;
			return 0;
		}

		// Token: 0x060004C6 RID: 1222 RVA: 0x002FBE35 File Offset: 0x002FA035
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060004C7 RID: 1223 RVA: 0x002FBE45 File Offset: 0x002FA045
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.viewAliasClause != null)
			{
				this.viewAliasClause.acceptChildren(v);
			}
			this.subquery.acceptChildren(v);
			v.postVisit(this);
		}

		// Token: 0x04001112 RID: 4370
		private TSelectSqlStatement subquery;

		// Token: 0x04001113 RID: 4371
		private TViewAliasClause viewAliasClause;

		// Token: 0x04001114 RID: 4372
		private TSourceToken stForce;

		// Token: 0x04001115 RID: 4373
		private TSourceToken stReplace;

		// Token: 0x04001116 RID: 4374
		private TObjectName rowTypeName;

		// Token: 0x04001117 RID: 4375
		private TRestrictionClause restrictionClause;

		// Token: 0x04001118 RID: 4376
		private TObjectName viewName;
	}
}
